-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dml : fix last insert id when autoid specified by user in first row. #11973
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any test case could cover it?
Addressed. @jackysp |
Codecov Report
@@ Coverage Diff @@
## master #11973 +/- ##
===========================================
Coverage 81.2597% 81.2597%
===========================================
Files 444 444
Lines 95116 95116
===========================================
Hits 77291 77291
Misses 12332 12332
Partials 5493 5493 |
b2d7678
to
670b21b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
cherry pick to release-3.0 in PR #11992 |
cherry pick to release-2.1 in PR #11993 |
What problem does this PR solve?
Fix last insert id when autoid specified by user in first row.
Table
before this PR
After this PR = MySQL's behavior
What is changed and how it works?
Last insert id is not strong lied with the first insert row.
More specifically, it does lie with the first row that without user specified autoID.
Change the judging logic, 0 is inited value meaning that last insert id hasn't be assigned. So do the assignment under the condition.
Check List
Tests
Related changes
Release note